<template>
  <a-layout class="basic-layout">
    <!-- 顶部导航栏 -->
    <GlobalHeader class="header-wrapper" />

    <!-- 主要内容区域 -->
    <a-layout-content class="main-content">
      <router-view />
    </a-layout-content>

    <!-- 底部版权信息 -->
    <GlobalFooter v-if="isShowFooter" />
  </a-layout>
</template>

<script setup lang="ts">
import GlobalHeader from '@/components/GlobalHeader.vue'
import GlobalFooter from '@/components/GlobalFooter.vue'
import { useRouter } from 'vue-router'
import { computed, onMounted, ref } from 'vue'

// const isShowFooter = ref<boolean>(true)
const router = useRouter()

const isShowFooter = computed(() => {
  if (router.currentRoute.value.name === 'chat') return false
  return true
})
onMounted(() => {
  console.log(router.currentRoute.value, 'ww')
})
</script>

<style scoped>
.basic-layout {
  background: none;
  min-height: 100vh; /* 确保布局占满整个视口高度 */
  display: flex;
  flex-direction: column;
}

.header-wrapper {
  position: fixed; /* 固定头部 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

/* .main-content {
  width: 100%;
  background: white;
  margin: 68px 0 0;
  box-sizing: border-box;
  flex: 1;
  overflow-y: auto;
   max-height: calc(100vh - 68px);
} */

.main-content {
  width: 100%;
  padding: 0;
  background: none;
  /* margin: 68px 0 0 0; */
  box-sizing: border-box;
  /* min-height: calc(100vh - 68px); */
}
</style>
